package com.ceba.test.modules.regist.logicService;

import java.util.List;
import java.util.Map;

import com.ceba.test.modules.regist.entity.Enterprise;
import com.ceba.test.modules.regist.entity.EnterpriseRegist;
import com.ceba.test.modules.regist.entity.EnterpriseRegisterLog;
import com.ceba.test.modules.regist.service.EnterpriseRegistLogService;
import com.ceba.test.modules.regist.service.EnterpriseRegistService;
import com.ceba.test.modules.regist.service.EnterpriseService;


public class RegistLogicService {
	
	private EnterpriseService enterpriseService;
	private EnterpriseRegistService enterpriseRegistService;
	private EnterpriseRegistLogService enterpriseRegistLogService;
	
	//EnterpriseService 类
	/**
	 * 添加一条记录
	 * @return
	 */
	public Boolean add(Enterprise enterprise) throws Exception{
		return enterpriseService.add(enterprise);
	}
	
	/**
	 * 删除一条数据
	 * @param id 数据id
	 * @return
	 */
	public Boolean delete(String id) throws Exception{
		return enterpriseService.delete(id);
	}
	
	
	public Boolean deleteByName(String enterpriseName) throws Exception{
		return enterpriseService.deleteByName(enterpriseName);
	}
	
	/**
	 * @return 公司名称唯一
	 */
	public Enterprise getEnterprise(String user,String email,String phone) throws Exception{
		return enterpriseService.getEnterprise(user, email, phone);
	}
	
	
	
	public boolean checkExistByNameAndActivateCode(String enterpriseName,String code) throws Exception{
		return enterpriseService.checkExistByNameAndActivateCode(enterpriseName, code);
	}
	
	
	public Enterprise getEnterpriseByName(String enterpriseName)throws Exception {
		return enterpriseService.getEnterpriseByName(enterpriseName);
	}
	
	
	//EnterpriseRegistService类
	
	/**
	 * 添加一条记录，默认试用日期从激活当日起3个月,签名份数3000
	 * @return
	 */
	public Boolean addEnterpriseRegist(EnterpriseRegist enterprise) throws Exception{
		return enterpriseRegistService.add(enterprise);
	}
	
	
	
	/**
	 * 删除一条数据
	 * @param id 数据id
	 * @return
	 */
	public Boolean deleteEnterpriseRegist(String id) throws Exception{
		return enterpriseRegistService.delete(id);
	}
	
	
	public Boolean deleteEnterpriseRegistByName(String enterpriseName) throws Exception{
		return enterpriseRegistService.deleteByName(enterpriseName);
	}
	
	
	public Boolean updateByName(String enterpriseName,String version,String signedCount, String alreadyActiveTimes) throws Exception{
		return enterpriseRegistService.updateByName(enterpriseName, version, signedCount, alreadyActiveTimes);
	}
	
	
	public Boolean updateServer(EnterpriseRegist enterpriseRegist) 
			throws Exception{
		return enterpriseRegistService.updateServer(enterpriseRegist);
	}
	
	
	public EnterpriseRegist getEnterpriseRegistByName(String enterpriseName)throws Exception {
		return enterpriseRegistService.getEnterpriseRegistByName(enterpriseName);
	}
	
	public boolean updateFormalUseTimeByName(String enterpriseName,String time) {
		return enterpriseRegistService.updateFormalUseTimeByName(enterpriseName, time);
	}
	
	
	public String queryEnterpriseRegist(String key, Map<String,Object> dic) {
		return enterpriseRegistService.queryEnterpriseRegist(key,dic);
	}
	
	public String queryEnterpriseRegistLogList(String key, Map<String,Object> dic) {
		return enterpriseRegistService.queryEnterpriseRegistLogList(key,dic);
	}
	
	//EnterpriseRegistLogService 类
	/**
	 * 添加一条记录
	 * @return
	 */
	public Boolean addEnterpriseRegisterLog(EnterpriseRegisterLog elog) throws Exception{
		return enterpriseRegistLogService.add(elog);
	}
	
	
	
	/**
	 * 删除一条数据
	 * @param id 数据id
	 * @return
	 */
	public Boolean deleteEnterpriseRegisterLog(String id) throws Exception{
		return enterpriseRegistLogService.delete(id);
	}
	
	
	/**
	 * 獲取导入信息信息
	 * @return
	 */
	public List<EnterpriseRegisterLog> getEnterpriseRegisterLogList(String feeType){
		return enterpriseRegistLogService.getEnterpriseRegisterLogList(feeType);
	}
	
	

	public EnterpriseService getEnterpriseService() {
		return enterpriseService;
	}

	public void setEnterpriseService(EnterpriseService enterpriseService) {
		this.enterpriseService = enterpriseService;
	}

	public EnterpriseRegistService getEnterpriseRegistService() {
		return enterpriseRegistService;
	}

	public void setEnterpriseRegistService(EnterpriseRegistService enterpriseRegistService) {
		this.enterpriseRegistService = enterpriseRegistService;
	}

	public EnterpriseRegistLogService getEnterpriseRegistLogService() {
		return enterpriseRegistLogService;
	}

	public void setEnterpriseRegistLogService(EnterpriseRegistLogService enterpriseRegistLogService) {
		this.enterpriseRegistLogService = enterpriseRegistLogService;
	}
	
    
}
